home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1996 / MacHack 1996.toast / Presentations / Presentations ’91 / DAL Files / DALtool 4⁄19 (System 6.x) / DalDemo.c < prev    next >
C/C++ Source or Header  |  1991-04-20  |  1KB  |  59 lines

  1. #include <QuickDraw.h>
  2. #include <MacTypes.h>
  3. #include <WindowMgr.h>
  4. #include <TextEdit.h>
  5. #include <ControlMgr.h>
  6. #include <EventMgr.h>
  7.  
  8. #include "DalDemo.h"
  9.  
  10. /* Global vars */
  11. Boolean gDone, gWNEImplemented;
  12. EventRecord    gTheEvent;
  13. MenuHandle    gAppleMenu, gFileMenu, gEditMenu;
  14. CharsHandle    gInText;
  15. Rect    gDragRect;
  16. Rect    gInRect = {22, 43, 160, 400},
  17.         gInScrollBarRect = {22,404,160,420},
  18.         gOutRect = {165, 43, 340, 400},
  19.         gOutScrollBarRect = {165,404, 340, 420};
  20. int        gNewWindowLeft = WINDOW_HOME_LEFT, gNewWindowTop = WINDOW_HOME_TOP;
  21. int        gLinesInFolder;
  22. char    gNodename[80], gUsername[80], gPassword[80];
  23. char     dirty;
  24.  
  25. /*** main ***/
  26. main()
  27. {
  28.     ToolBoxInit();
  29.     MenuBarInit();
  30.     SetUpDragRect();
  31.     MaxApplZone();
  32.     GlobalVarInit();
  33.     
  34.     MainLoop();
  35. }
  36.  
  37.  
  38. /*** MainLoop ***/
  39. MainLoop()
  40. {
  41.     Boolean    gotOne;
  42.     
  43.     while (!gDone)
  44.     {
  45.         if (gWNEImplemented)
  46.             gotOne = WaitNextEvent(everyEvent, &gTheEvent, MIN_SLEEP, NIL_MOUSE_REGION);
  47.         else
  48.         {
  49.             SystemTask();
  50.             gotOne = GetNextEvent(everyEvent, &gTheEvent);
  51.         }
  52.         if (gotOne)
  53.             HandleEvent();
  54.         else
  55.             HandleIdle();
  56.     }
  57. }
  58.  
  59.